Conversation
| <dd>returns $-1$, $0$ or $1$ depending on whether $x$ is negative, | ||
| zero or positive. | ||
| </dl> | ||
| 'RealSign' is also known as $sgn$ or $signum$ function. |
There was a problem hiding this comment.
If it is signum, we should add that before the WMA link a wikipedia link: https://en.wikipedia.org/wiki/Sign_function
mathics/eval/testing_expressions.py
Outdated
| from mathics.core.systemsymbols import SymbolDirectedInfinity | ||
|
|
||
|
|
||
| # TODO: Remove me. The following function is not used anywhere |
There was a problem hiding this comment.
If it is not used, please remove it. It will live pretty much forever in git.
|
LGTM - just small comments about documenting RealSign and the placement of the new builtins. Merge whenever you feel ready. |
|
I see RealSign and RealAbs under Numerical Functions not Testing Expressions |
| <dt>'RealAbs[$x$]' | ||
| <dd>returns the absolute value of a real number $x$. | ||
| </dl> | ||
| 'RealAbs' is also known as modulus. It is evaluated if $x$ can be compared \ |
There was a problem hiding this comment.
Same comment about Wiki reference.
Right now, they are under |
|
Regarding the place, and to reduce the noise, I prefer to keep |
| <url>:WMA link:https://reference.wolfram.com/language/ref/RealAbs.html</url> | ||
|
|
||
| <url> | ||
| :Signum: |
There was a problem hiding this comment.
The link name should be what Wikipedia calls it, so this should be "Sign function". Wikipedia mentions that this is also called "Signum"
There was a problem hiding this comment.
Ok, I can change this in another iteration.
There was a problem hiding this comment.
I have included that change in #886, which is the next round of patches.
This PR implements two new builtins. Also, its low-level implementation is used to simplify some of the low-level eval functions in arithmetic and testing expressions.